package com.qf.controller;

import com.qf.constans.ResultCode;
import com.qf.dto.R;
import com.qf.entity.CheckType;
import com.qf.entity.TNotify;
import com.qf.service.NotifyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.lang.reflect.Type;

/*
杨威
2021/10/30
10:40
*/
@RestController
@RequestMapping("/notify")
@Api("缓存")
public class NotifyController {
    @Autowired
    private NotifyService notifyService;
    @PutMapping("/notify")
    @ApiOperation("修改缓存")
    public R updateNotify(@RequestBody @ApiParam(name = "tNotify",value = "缓存实体类") TNotify tNotify){

        notifyService.updateNotify(tNotify);
        return R.setOk();
    }
    @PostMapping("/notify")
    @ApiOperation("添加缓存")
    public R addNotify(@RequestBody TNotify tNotify){
        notifyService.addNotify(tNotify);
        return R.setOk();
    }
    @DeleteMapping("/notify")
    @ApiOperation("删除缓存")
    public R deleteNotify(Long id){
        notifyService.deleteNotify(id);
        return R.setOk();
    }

}
